display: Insist that backends implement the monitor vfuncs
authorBenjamin Otte <otte@redhat.com>
Fri, 9 Sep 2016 12:52:06 +0000 (14:52 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 16 Oct 2016 16:17:21 +0000 (18:17 +0200)
We cannot fallback anymore once we remove the ability to query screen
size, and that's about to happen.

gdk/gdkdisplay.c

index 5d49aad9f10242e3457e3dd05690f07b9cf7514a..e7f04630a3f5ae3e9bb799b8d73ab43478c8f8eb 100644 (file)
@@ -2545,32 +2545,6 @@ gdk_display_get_n_monitors (GdkDisplay *display)
   return GDK_DISPLAY_GET_CLASS (display)->get_n_monitors (display);
 }
 
-static GdkMonitor *
-get_fallback_monitor (GdkDisplay *display)
-{
-  static GdkMonitor *monitor = NULL;
-  GdkScreen *screen;
-
-  if (monitor == NULL)
-    {
-      g_warning ("%s does not implement the monitor vfuncs", G_OBJECT_TYPE_NAME (display));
-      monitor = gdk_monitor_new (display);
-      gdk_monitor_set_manufacturer (monitor, "fallback");
-      gdk_monitor_set_position (monitor, 0, 0);
-      gdk_monitor_set_scale_factor (monitor, 1);
-    }
-
-  screen = gdk_display_get_default_screen (display);
-  gdk_monitor_set_size (monitor,
-                        gdk_screen_get_width (screen),
-                        gdk_screen_get_height (screen));
-  gdk_monitor_set_physical_size (monitor,
-                                 gdk_screen_get_width_mm (screen),
-                                 gdk_screen_get_height_mm (screen));
-
-  return monitor;
-}
-
 /**
  * gdk_display_get_monitor:
  * @display: a #GdkDisplay
@@ -2588,9 +2562,6 @@ gdk_display_get_monitor (GdkDisplay *display,
 {
   g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
 
-  if (GDK_DISPLAY_GET_CLASS (display)->get_monitor == NULL)
-    return get_fallback_monitor (display);
-
   return GDK_DISPLAY_GET_CLASS (display)->get_monitor (display, monitor_num);
 }